import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import HomeContainer from '@/components/tapper/HomeContainer'
import MemberContainer from '@/components/tapper/MemberContainer'
import ShopCarContainer from '@/components/tapper/ShopCarContainer'
import SearchContainer from '@/components/tapper/SearchContainer'
import NewsListContainer from '@/components/news/newsList'
import NewsInfoContainer from '@/components/news/newsInfo'
import PhotoList from '../components/photo/photoList'
import photoInfo from '../components/photo/photoInfo'
import goodLists from '../components/goods/GoodsList'
import goodsInfo from '../components/goods/GoodsInfo'
import GoodDesc from '../components/goods/GoodDesc'
import GoodsComment from '../components/goods/GoodsComment'

Vue.use(Router)

export default new Router({
  routes: [
    // 默认打开就在首页
    {
      path: '/',
      redirect: '/home'
    }, {
      path: '/home',
      component: HomeContainer
    },
    {
      path: '/vip',
      component: MemberContainer
    },
    {
      path: '/shopcar',
      component: ShopCarContainer
    },
    {
      path: '/search',
      component: SearchContainer
    },
    {
      path: '/home/newsList',
      component: NewsListContainer
    },
    {
      path: '/home/newsInfo/:id',
      component: NewsInfoContainer
    },
    {
      path: '/home/photoList',
      component: PhotoList
    },
    {
      path: '/home/photoInfo/:id',
      component: photoInfo
    },
    {
      path: '/home/goodsList',
      component: goodLists
    },
    {
      path: '/home/goodsinfo/:id',
      component: goodsInfo,
      name: 'goodsinfo'
    },
    {
      path: '/home/goodsdesc/:id',
      component: GoodDesc,
      name: 'GoodDesc'
    },
    {
      path: '/home/goodscomment/:id',
      component: GoodsComment,
      name: 'GoodsComment'
    }
    // name:路由的名 命名路由
  ],
  linkActiveClass: 'mui-active'
})
